package com.ccx.coachsite.downloadmgr;



import java.io.Serializable;
import java.util.ArrayList;

import android.graphics.Bitmap;

/**
 * 下载对象的通用基类
 */
public class DownloadItem implements Serializable {
	
	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = -4044149646523291126L;
	public final static int STATUS_NONE=-1; //普通状态，即不属于下面四个的任何状态
	public final static int STATUS_DOWNLOADING=40000; //正在下载
	public final static int STATUS_DOWNLOADED=40001; //已下载
	public final static int STATUS_DOWNLOAD_FAILED=40002;//下载失败
	public final static int STATUS_INSTALLED=40003; //已安装
	public final static int STATUS_UPGRADABLE=40004;//可升级
	public final static int STATUS_DOWNLOAD_PAUSE=40005;//下载暂停
	public final static String EXTRA_ME="extra_downloaditem";
	/**
	 * 软件在服务器端的ID
	 */
	protected String sid;
	
	/**
	 * 软件名称
	 */
	protected String title;
	
	/**
	 * 软件图标
	 */
	transient protected Bitmap icon;
	
	
	/**
	 * 图标文件的本地路径
	 */
	protected String iconPath;
	/**
	 * 软件图标下载地址
	 */
	protected String iconUrl;
	
	/**
	 * 预览图
	 */
	protected Bitmap preImage;
	
	/**
	 * 预览图下载地址
	 */
	protected String preImageUrl;
	
	/**
	 * 预览图下载地址数组
	 */
	public ArrayList<String> preImageUrlsList = new ArrayList<String>();
	
	/**
	 * 预览图在本地的存放路径
	 */
	protected String preImagePath;
	
	/**
	 * 包名
	 */
	protected String pkgName;
	
	/**
	 * 最后更新时间
	 */
	protected String updateTime;
	
	/**
	 * 版本，网络端的版本，不是本地版本
	 */
	protected String availVersion;//可升级至的版本名称如2.0.1
	
	/**
	 * 版本，网络端的版本，不是本地版本
	 */
	protected String availVersionCode;//可升级至的版本号如201
	
	/**
	 * 软件下载地址
	 */
	protected String downloadUrl;
	
	/**
	 * 软件详情url
	 */
	protected String detailUrl;
	
	/**
	 * 文件总大小，以字节上计算
	 */
	protected long fileBytes;
	
	/**
	 * 已下载的字节数  小于或等于 fileBytes
	 */
	protected long downloadBytes;
	
	/**
	 * 下载完成的时间
	 */
	protected String downloadTime;
	
	/**
	 * 下载状态,默认是普通状态
	 */
	protected int status=STATUS_NONE;

	/**
	 * 文件保存路径
	 */
	protected String filePath;
	
	/**
	 * 总记录数
	 */
	protected int itemCount;
	
	/**
	 * 下载次数
	 */
	protected String downloadCount;
	
	/**
	 * 评分,也称作推荐星级
	 */
	protected float grade;
	
	/**
	 * 热度，应该是与下载次数有关
	 */
	protected int hotLevel;
	
	/**
	 * 软件语言
	 */
	protected String language;
	
	/**
	 * 软件介绍
	 */
	protected String introduction;
	
	/**
	 * 收费或是免费
	 */
	protected String fee;
	
	/**
	 * 软要求的SDK版本
	 */
	protected String sdkVersion;
	
	/**
	 * 软件所属分类
	 */
	protected String categoryName;
	
	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public String getSdkVersion() {
		return sdkVersion;
	}

	public void setSdkVersion(String sdkVersion) {
		this.sdkVersion = sdkVersion;
	}

	public String getSid() {
		//sid的默认值
		if(sid==null||sid.trim().length()==0)
			sid=""+(int)System.currentTimeMillis();
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Bitmap getIcon() {
		return icon;
	}

	public void setIcon(Bitmap icon) {
		this.icon = icon;
	}

	public String getIconPath() {
		return iconPath;
	}

	public void setIconPath(String iconPath) {
		this.iconPath = iconPath;
	}

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	
	public Bitmap getPreImage() {
		return preImage;
	}

	public void setPreImage(Bitmap preImage) {
		this.preImage = preImage;
	}

	public String getPreImageUrl() {
		return preImageUrl;
	}

	public void setPreImageUrl(String preImageUrl) {
		this.preImageUrl = preImageUrl;
	}

	public String getPreImagePath() {
		return preImagePath;
	}

	public void setPreImagePath(String preImagePath) {
		this.preImagePath = preImagePath;
	}

	public String getPkgName() {
		return pkgName;
	}

	public void setPkgName(String pkgName) {
		this.pkgName = pkgName;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}


	public String getAvailVersion() {
		return availVersion;
	}

	public void setAvailVersion(String availVersion) {
		this.availVersion = availVersion;
	}

	public String getDownloadUrl() {
		return downloadUrl;
	}

	public void setDownloadUrl(String downloadUrl) {
		this.downloadUrl = downloadUrl;
	}

	public String getDetailUrl() {
		return detailUrl;
	}

	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}

	public long getFileBytes() {
		return fileBytes;
	}

	public void setFileBytes(long fileBytes) {
		this.fileBytes = fileBytes;
	}

	public long getDownloadBytes() {
		return downloadBytes;
	}

	public void setDownloadBytes(long downloadBytes) {
		this.downloadBytes = downloadBytes;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getDownloadTime() {
		return downloadTime;
	}

	public void setDownloadTime(String downloadTime) {
		this.downloadTime = downloadTime;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public int getItemCount() {
		return itemCount;
	}

	public void setItemCount(int itemCount) {
		this.itemCount = itemCount;
	}


	
	public String getDownloadCount() {
		return downloadCount;
	}

	public void setDownloadCount(String downloadCount) {
		this.downloadCount = downloadCount;
	}

	public float getGrade() {
		return grade;
	}

	public void setGrade(float grade) {
		this.grade = grade;
	}

	public int getHotLevel() {
		return hotLevel;
	}

	public void setHotLevel(int hotLevel) {
		this.hotLevel = hotLevel;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getFee() {
		return fee;
	}

	public void setFee(String fee) {
		this.fee = fee;
	}

	public String getAvailVersionCode() {
		return availVersionCode;
	}

	public void setAvailVersionCode(String availVersionCode) {
		this.availVersionCode = availVersionCode;
	}
	
}























